<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1, user-scalable=0, minimal-ui" charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/index.css" />
		<link rel="stylesheet" href="css/swiper.css" />
		<link rel="stylesheet" href="css/mint.css">
	</head>
		<script src="js/serverUrl.js"></script>
		<script src="js/vue.js"></script>
		<script src="js/mint.js"></script>
		<script src="js/moment.js"></script>
	<body>
		<div id="app">
			<div id="table" class="card" style="background-color:#f0f0f0">
				<div v-for="item in courseList" class="trainingItem">
					<div class="trainingTitle"><span ><img src="img/training_record.png" class="titeImage"></span>{{item.courseName}}</div>
					<div class="trainingRow">
						<div class="trainingInfo">培训老师：{{item.courseName}}</div>
						<div class="trainingInfo">课时：{{item.courseHour}}</div>
					</div>
					<div class="trainingInfo">上课日期：{{item.startTime | formatDay }}</div>
					<div class="trainingInfo" >上课时间：{{item.startTime |formatTime}} -- {{item.endTime |formatTime}}</div>
					<div class="trainingInfo">签到时间：{{item.signTime | formatSignTime }}</div>
					<div class="trainingInfo" style="margin-bottom: 10px;">上课地点：{{item.coursePlace}}</div>
					<div class="opertionContainer">
<!--                        <div class="trainingOperation" @click.stop="toApprise()">-->
<!--							<img src="img/training_consulotion.png" class="operationImage" />-->
<!--							<div class="operationName">课程评价</div>-->
<!--						</div>-->
						
						<div class="trainingOperation" @click.stop="toSign(item.classCourseId)">
							<img src="img/training_code.png" class="operationImage"  />
							<div class="operationName">签到列表</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		var app = new Vue({
		  el: '#app',
		  data:{
		  courseList:
			[],
		  },
		  filters:{
			formatTime(val){
				if (val == null) {
					return ""
				}
				return moment(val).format("HH:mm")
			},
			formatDay (val) {
				if (val == null) {
					return ""
				}
				return moment(val).format("YYYY年MM月DD日")
			},
			formatSignTime (val) {
				if (val == null) {
					return ""
				}
				return moment(val).format("YYYY年MM月DD日 HH:mm:ss")
			}
		  },
		  created() {
			window.getCourseList = this.getCourseList
            window.clear = this.clear
		  },
		  methods:{
              clear(){
                  this.courseList = []
              },
              toApprise(){
                  WebViewJavascriptBridge.callHandler('toApprise',{},function(response) {
                                         
                  });
              },
			  getCourseList (courseList){
				this.courseList = courseList
			  },
              toSign(courseId){
                  let params = {
                      courseId:courseId
                  }
                  WebViewJavascriptBridge.callHandler('toClassSign',params,function(response) {
                                          
                   });
              },
		  }
		})		
		</script>
</html>
